home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / scripts / uqwk_soup.ncomm.script < prev   
Text File  |  1998-05-24  |  3KB  |  139 lines

  1. ; $VER: UQWK_SOUP.script 2.0 (29.9.94)
  2. ; UQWK_SOUP script for THOR and NComm
  3. ; Author: Petter Nilsen, Ultima Thule Software
  4. ;
  5. ; Expects the supplied GRAB unix script in the path on the
  6. ; remote machine.
  7. ;
  8. ; Will not delete the #?.out file after upload, this must be done
  9. ; with the requester that pops up when entering the BBS in THOR again
  10. ; before parsing.
  11. ;
  12.  
  13.     REQUEST OFF
  14.  
  15. ; If you do not supply a login name here, the script will use the 
  16. ; user name from the NComm phonebook.
  17.     set $loginname = "pettern\n"        ; login name, don't forget the "\n"
  18.     set $shellprompt = "lightning:~>"    ; shell prompt on you unix system, change to fit
  19.  
  20.     cli $THORPath"bin/ScriptServ \""$BBSName"\" WRITECFG EV 0 EV 1"
  21.  
  22.     varfile "t:"$BBSName".CONFIG"
  23.  
  24.     readvar $CfgVer
  25.     readvar $BBSID
  26.     readvar $BBSType
  27.     readvar $Path
  28.     readvar $PostConf
  29.     readvar $UpLoadDir
  30.     readvar $UserName
  31.     readvar $UserStreet
  32.     readvar $UserAddress
  33.     readvar $UserCountry
  34.     readvar $UserPhone
  35.     readvar $NewFiles
  36.     readvar $AutoPDnl
  37.     readvar $AutoLogoff
  38.     readvar $UseColors
  39.     varfile close
  40.  
  41.     if !$CfgVer == "4" then message "Incompatible version of ScriptServ"
  42.     if !$CfgVer == "4" then goto AllDone
  43.  
  44.     cli "delete >nil: \"t:"$BBSName".CONFIG\""
  45.  
  46.     when "\r\nNO CARRIER\r\n" goto AllDone
  47. ;    when "Login incorrect" goto Login
  48.  
  49.     autoxfer off ; Turn off G&R commands
  50.     autoup off   ; Turn off Zmodem autoupload
  51.     autodown on  ; Turn on Zmodem autodownload
  52.  
  53.     menuselect TRANSLATE 1 0 ; Use ISO character set
  54.  
  55. ;
  56. ;***************** Login sequence
  57. ;
  58. Login:
  59.     converse "login:" $loginname
  60.     converse "Password:" "\p\n"
  61. ;
  62. ;***************** Do UQWK_SOUP packet handling
  63. ;
  64.     wait $shellprompt
  65.     send "\n"
  66.  
  67. eventLoop:
  68.     set $done = "FALSE"
  69.  
  70.     if !exists "t:"$BBSName".EVENTS" then goto HandleSOUP
  71.     varfile "t:"$BBSName".EVENTS"
  72.  
  73.     readvar $eventnr
  74.     readvar $event
  75.  
  76.     if $eventnr == "EOF" then goto evLoopEnd
  77.     if $event   == "EOF" then goto evLoopEnd
  78.  
  79.     if $event == "12" then gosub AutoLogOff
  80.  
  81.     if $event == "7769"  then set $done = "TRUE"
  82.  
  83.     if  $done == "TRUE" then cli "run >nil: "$THORPath"bin/ScriptServ \""$BBSName"\" DONE "$eventnr
  84.     if !$done == "TRUE" then cli "run >nil: "$THORPath"bin/ScriptServ \""$BBSName"\" ERROR "$eventnr
  85.  
  86.     goto eventLoop    
  87.  
  88. evLoopEnd:
  89.     varfile close
  90.  
  91. HandleSOUP:
  92.  
  93.     if exists $UpLoadDir$BBSID".out" then set $docmd = "grab -u\n"
  94.     if !exists $UpLoadDir$BBSID".out" then set $docmd = "grab -u -r\n"
  95.     
  96.     gosub DoCommand
  97.  
  98.     when "B01" upload $UpLoadDir$BBSID".out",Z
  99.  
  100.     send "\n\n"
  101.  
  102.     wait $shellprompt
  103.     cli "run >nil: sys:rexxc/rx 'address THOR.01 RESCAN'"
  104.     dlwhen
  105.     goto AllDone
  106.  
  107. ;************************************************
  108. DoCommand:
  109.     converse $shellprompt $docmd
  110.     return
  111.  
  112. ;************************************************
  113. ; Set the autologoff flag.
  114. ; Uses variables:
  115. ;  $boolean - Logoff (y/n)
  116. AutoLogOff:
  117.     readvar $boolean
  118.  
  119.     set $AutoLogoff = "y"
  120.     if $boolean == "0" then set $AutoLogoff = "n"
  121.     set $done = "TRUE"
  122.  
  123.     return
  124.  
  125. ;************************************************
  126. AllDone:
  127.     if $AutoLogoff == "n" then goto NoLogOut
  128.     gosub DoLogOut
  129.  
  130. NoLogOut:
  131.     request on
  132.     end
  133.  
  134. DoLogOut:
  135.     set $docmd = "logout\n"
  136.     gosub DoCommand
  137.  
  138.